package com.aifund.common.entity;

import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;


import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 机器人
 */
@Entity
@SQLDelete(sql = "update ai_robot set delete = 1 where id = ?")
@Where(clause = "is_del = 0")
@Data
@EntityListeners(AuditingEntityListener.class)
public class AiRobot {
    @Id
    @GeneratedValue
    private Long id;

    private String nickName;//昵称

    private String header; // 头像

    private String currency; //币种

    private Double star; //评分

    private Long exchangeId;//交易所ID

    private BigDecimal earningsLastMonth;//上月收益

    private BigDecimal annualizedIncome;//年化收益

    private BigDecimal totalRevenue;//总收益

    private String descContext; //描述

    private String textContext;//内容

    private BigDecimal feeRate;// 费用


    @CreatedDate
    @Column(name = "createTime",updatable = false,nullable = false)
    private Date createTime;

    @LastModifiedDate
    @Column(name = "updateTime",nullable = false)
    private Date updateTime;

    @Type(type = "org.hibernate.type.NumericBooleanType")
    private Boolean isDel = false;

}
